package com.zqxq.lottery.common.utils;

import com.zqxq.common.utils.StrUtils;

public class CurrencyUtil {

    public static String amountConversion(String amount) {
        if (StrUtils.isEmpty(amount)) {
            return "";
        }
        if (amount.indexOf(".") != -1) {
            amount = amount.substring(0, amount.indexOf("."));
        }
        amount = amount.trim().replaceAll(",", "");
        if (amount.length() >= 9) {
            return "奖池超" + amount.substring(0, amount.length() - 8) + "亿";
        }
        if (amount.length() >= 5) {
            return "奖池超" + amount.substring(0, amount.length() - 4) + "万";
        }
        return amount;
    }
    
}
